<ion-header>
  <ion-navbar>
    <ion-title>应急救援</ion-title>
  </ion-navbar>
</ion-header>


<ion-content class="emergencyrescue">
  <ion-list>
    <ion-item>
      <ion-label>接到报警时间:</ion-label>
      <ion-datetime placeholder="请选择救援开始时间" cancelText="取消" doneText="确定" displayFormat="YYYY-MM-DD HH:mm:ss"
        [(ngModel)]="emergencyRescueBean.receivedTime"></ion-datetime>
    </ion-item>
    <ion-item>
      <ion-label>到达现场时间:</ion-label>
      <ion-datetime placeholder="请选择到达现场时间" cancelText="取消" doneText="确定" displayFormat="YYYY-MM-DD HH:mm:ss"
        [(ngModel)]="emergencyRescueBean.arrivedTime"></ion-datetime>
    </ion-item>
    <ion-item>
      <ion-label>救援结束时间:</ion-label>
      <ion-datetime placeholder="请选择救援结束时间" cancelText="取消" doneText="确定" displayFormat="YYYY-MM-DD HH:mm:ss"
        [(ngModel)]="emergencyRescueBean.rescueEndTime"></ion-datetime>
    </ion-item>
    <ion-item>
      <ion-label>有无伤亡人员:</ion-label>
      <ion-toggle [(ngModel)]="isDisabled"></ion-toggle>
    </ion-item>
    <div *ngIf="isDisabled">
      <ion-item>
        <ion-label>轻伤几人:</ion-label>
        <ion-input placeholder="请输入有几人轻伤" type="number" [(ngModel)]="emergencyRescueBean.minorWoundNum"></ion-input>
      </ion-item>
      <ion-item>
        <ion-label>重伤几人:</ion-label>
        <ion-input type="number" placeholder="请输入有几人重伤" [(ngModel)]="emergencyRescueBean.injuredNum"></ion-input>
      </ion-item>
      <ion-item>
        <ion-label>死亡几人:</ion-label>
        <ion-input type="number" placeholder="请输入有几人死亡" [(ngModel)]="emergencyRescueBean.deathNum"></ion-input>
      </ion-item>
    </div>
    <ion-item>
      <ion-label>救援后的防护措施:</ion-label>
      <ion-select [(ngModel)]="emergencyRescueBean.protective" placeholder="请选择" multiple="true" cancelText="取消" okText="确定">
        <ion-option value="1">层门封堵</ion-option>
        <ion-option value="2">封闭通道</ion-option>
        <ion-option value="3">设置警戒线</ion-option>
        <ion-option value="4">封闭现场</ion-option>
        <ion-option value="6">检查后符合安全要求，继续投入使用</ion-option>
        <ion-option value="5">其它措施</ion-option>
      </ion-select>
    </ion-item>
    <ion-item>
      <ion-label>其他措施:</ion-label>
      <ion-input placeholder="若其他措施请说明" type="text" [(ngModel)]="emergencyRescueBean.protectiveOth"></ion-input>
    </ion-item>
    <ion-item>
      <ion-label>救援实施单位:</ion-label>
      <ion-input placeholder="请输入救援实施单位" type="text" (blur)="queryParty()" [(ngModel)]="rescuePartyName"></ion-input>
    </ion-item>
    <ion-item>
      <ion-label>救援成员1:</ion-label>
      <ion-input placeholder="请输入救援人员姓名" type="text" [(ngModel)]="emergencyRescueBean.rescueUserName1"></ion-input>
    </ion-item>
    <ion-item>
      <ion-label>救援成员2:</ion-label>
      <ion-input placeholder="请输入救援人员姓名" type="text" [(ngModel)]="emergencyRescueBean.rescueUserName2"></ion-input>
    </ion-item>



    <ion-item>
      <ion-label>人为原因:</ion-label>
      <ion-select style="max-width: 300px;" [(ngModel)]="humanReasonParam" placeholder="请选择人为原因" multiple="true" cancelText="取消" okText="确定">
        <div *ngFor="let reasons of humanReason">
         <ion-option value="{{reasons.faultCode}}" >{{reasons.faultAnalysis}}</ion-option>
        </div>
      </ion-select>
    </ion-item>


    <ion-item>
      <ion-label>外部原因:</ion-label>
      <ion-select style="max-width: 300px;" [(ngModel)]="outsideReasonParam" placeholder="请选择外部原因" multiple="true" cancelText="取消" okText="确定">
        <div *ngFor="let outside of outsideReason">
          <ion-option value="{{outside.faultCode}}" >{{outside.faultAnalysis}}</ion-option>
        </div>
      </ion-select>
    </ion-item>

    <ion-item>
      <ion-label>门系统:</ion-label>
      <ion-select style="max-width: 300px;" [(ngModel)]="doorSystemParam" placeholder="请选择门系统" multiple="true" cancelText="取消" okText="确定">
        <div *ngFor="let door of doorSystem">
          <ion-option value="{{door.faultCode}}" >{{door.faultAnalysis}}</ion-option>
        </div>
      </ion-select>
    </ion-item>

    <ion-item>
      <ion-label>曳引系统:</ion-label>
      <ion-select style="max-width: 300px;" [(ngModel)]="tractionSystemParam" placeholder="请选择曳引系统" multiple="true" cancelText="取消" okText="确定">
        <div *ngFor="let traction of tractionSystem">
          <ion-option value="{{traction.faultCode}}" >{{traction.faultAnalysis}}</ion-option>
        </div>
      </ion-select>
    </ion-item>

    <ion-item>
      <ion-label>导向系统:</ion-label>
      <ion-select style="max-width: 300px;" [(ngModel)]="guideSystemParam" placeholder="请选择导向系统" multiple="true" cancelText="取消" okText="确定">
        <div *ngFor="let guide of guideSystem">
          <ion-option value="{{guide.faultCode}}" >{{guide.faultAnalysis}}</ion-option>
        </div>
      </ion-select>
    </ion-item>

    <ion-item>
      <ion-label>桥厢:</ion-label>
      <ion-select style="max-width: 300px;" [(ngModel)]="bridgeCabinParam" placeholder="请选择桥厢" multiple="true" cancelText="取消" okText="确定">
        <div *ngFor="let bridge of bridgeCabin">
          <ion-option value="{{bridge.faultCode}}" >{{bridge.faultAnalysis}}</ion-option>
        </div>
      </ion-select>
    </ion-item>

    <ion-item>
      <ion-label>控制系统:</ion-label>
      <ion-select style="max-width: 300px;" [(ngModel)]="controlSystemParam" placeholder="请选择控制系统" multiple="true" cancelText="取消" okText="确定">
        <div *ngFor="let control of controlSystem">
          <ion-option value="{{control.faultCode}}" >{{control.faultAnalysis}}</ion-option>
        </div>
      </ion-select>
    </ion-item>

    <ion-item>
      <ion-label>电气系统:</ion-label>
      <ion-select style="max-width: 300px;" [(ngModel)]="electricSystemParam" placeholder="请选择电气系统" multiple="true" cancelText="取消" okText="确定">
        <div *ngFor="let electric of electricSystem">
          <ion-option value="{{electric.faultCode}}" >{{electric.faultAnalysis}}</ion-option>
        </div>
      </ion-select>
    </ion-item>

    <ion-item>
      <ion-label>安全保护装置:</ion-label>
      <ion-select style="max-width: 300px;" [(ngModel)]="safeRefinementParam" placeholder="请选择安全保护装置" multiple="true" cancelText="取消" okText="确定">
        <div *ngFor="let safe of safeRefinement">
          <ion-option value="{{safe.faultCode}}" >{{safe.faultAnalysis}}</ion-option>
        </div>
      </ion-select>
    </ion-item>






    <div class="area">
      <div class="content">
        <p>事故原因:</p>
        <ion-textarea rows="5" type="text" placeholder="请输入原因" [(ngModel)]="emergencyRescueBean.accidentReason"></ion-textarea>
      </div>
    </div>
    <ion-card>
      <div class="camera" style="text-align: left;margin-top: 0%;background: #fff">
        <p>救援照片</p>
        <img *ngFor="let pic of images " (click)="onHold(pic)" src="{{appConfig.IP_URL+appConfig.API.getUpload+pic}}"/>
        <img src="assets/icon/remark_camera.png" (click)="presentActionSheet('c')">
      </div>
    </ion-card>
    <div class="area1">
      <p style="line-height: 18px; font-size: 14px;">
        <img style="vertical-align: middle; display: inline-block; width: 18px; margin-right: 4px;" src="assets/icon/icon_remind.png">安全管理员请在签完名后点击保存</p>
      <signatrue [inValue]="time1" (outPut)="getSafeImgUrl($event)"></signatrue>
    </div>

    <div class="area1">
      <p style="line-height: 18px; font-size: 14px;">
        <img style="vertical-align: middle; display: inline-block; width: 18px; margin-right: 4px;" src="assets/icon/icon_remind.png">维保人员1请在签完名后点击保存</p>
      <signatrue [inValue]="time2" (outPut)="getMaintImgUrl($event)"></signatrue>
    </div>

    <div class="area1">
      <p style="line-height: 18px; font-size: 14px;">
        <img style="vertical-align: middle; display: inline-block; width: 18px; margin-right: 4px;" src="assets/icon/icon_remind.png">维保人员2请在签完名后点击保存</p>
      <signatrue [inValue]="time3" (outPut)="getMaintImgUrl2($event)"></signatrue>
    </div>

  </ion-list>

  <button ion-button (click)="submit()" class="submit">提交</button>
</ion-content>